<div id="quotes" class="alternate_table">
  <table cellpadding="0" cellspacing="0">
    <tbody>
      <?php foreach($pager->getResults() as $i => $quote): ?>
        <tr class="<?php echo ($i%2==0)?'even':'odd' ?>">
          <td>
            <p>
              <?php echo $quote->getContent() ?>
            </p>
          </td>
          <td class="right_sided">
            <?php if($sf_user->isAuthenticated()): ?>
              <?php if($quote->isBookmark($sf_user->getAttribute('user_id', null, 'sfGuardSecurityUser'))): ?>
                <a class="remove_book" title="Remove from bookmarks" href="<?php echo url_for('profile/removeBookmark?quote_id='.$quote->getId()) ?>"></a>
              <?php else: ?>
                <a class="add_book" title="Add to bookmarks" href="<?php echo url_for('profile/addBookmark?quote_id='.$quote->getId()) ?>"></a>
              <?php endif ?>
            <?php endif ?>
          </td>
        </tr>
      <?php endforeach ?>
    </tbody>
    <tfoot>
    <tr>
      <td>
        <?php if ($pager->haveToPaginate()): ?>
          <div class="pagination">
            <a href="<?php echo url_for('@author_show?slug='.$author->getSlug().'&page=1') ?>">
              << First
            </a>

            <a href="<?php echo url_for('@author_show?slug='.$author->getSlug().'&page='.$pager->getPreviousPage()) ?>">
              < Previous
            </a>

            <?php if($pager->getPage() > 3): ?> ... <?php endif ?>

            <?php foreach ($pager->getLinks() as $page): ?>
              <?php if ($page == $pager->getPage()): ?>
                <?php echo $page ?>
              <?php else: ?>
                <a href="<?php echo url_for('@author_show?slug='.$author->getSlug().'&page='.$page) ?>">
                  <?php echo $page ?>
                </a>
              <?php endif ?>

            <?php endforeach ?>

            <?php if($pager->getLastPage() - $pager->getPage() > 3): ?> ... <?php endif ?>

            <a href="<?php echo url_for('@author_show?slug='.$author->getSlug().'&page='.$pager->getNextPage()) ?>">
              Next >
            </a>

            <a href="<?php echo url_for('@author_show?page='.$pager->getLastPage().'&slug='.$author->getSlug()) ?>">
               Last >>
            </a>
          </div>
        <?php endif; ?>
      </td>
    </tr>

    <tr>
      <td>
        <div class="pagination_desc">
          <strong><?php echo count($pager) ?></strong> quotes from this author

          <?php if ($pager->haveToPaginate()): ?>
            - page <strong><?php echo $pager->getPage() ?> of <?php echo $pager->getLastPage() ?></strong>
          <?php endif; ?>
        </div>
      </td>
    </tr>

    </tfoot>
  </table>
</div>
